package cn.crism.utils;

import org.apache.commons.lang3.StringUtils;

/**
 * @CreateDate: 2018/12/13 3:43 PM
 * @Description: 用于层级处理 0.1  0.1.2
 * @Author: Crism
 */
public class LevelUtil {

    public final static String SEPARATOR = ".";
    public final static String ROOT = "0";

    public static String calculateLevel(String deptLevel, int deptId) {
        if (StringUtils.isBlank(deptLevel)) {
            return ROOT;
        } else {
            return StringUtils.join(deptLevel, SEPARATOR, deptId);
        }
    }

}
